package org.wmq.commonutil.result;

public class Result<T> {
    private int code;
    private String message;
    private T data;
    private Result(){}
    private Result(int code,String message,T data){
        this.code = code;
        this.message = message;
        this.data = data;
    }
    public static <T> Result<T> success(T data){
        return new Result<>(200,"success",data);
    }
    public static <T>Result<T> success(){
        return success(null);
    }
    public static <T> Result<T> error(String message){
        return new Result<>(500,message,null);
    }
}
